@import "includes/open-sans";
@import "includes/roboto-mono";
@import "includes/dracula";

// Families
$open-sans: "Open Sans", Helvetica, Arial, Calibri, sans-serif;
$roboto-mono: "Roboto Mono", Menlo, "Courier New", Courier, monospace;

// Inter weights
$open-sans-regular:    400;
$open-sans-bold:       500;
$open-sans-extra-bold: 700;

// Roboto weights
$roboto-mono-regular:  400;
$roboto-mono-bold:     700;

// Colors
$white: #ffffff;
$off-white: #f2f2f2;
$black: #101820;
$green: #59b287;
$light-grey: #f5f5f5;
$dark-grey: #303030;
$dark-blue: #1a232c;
$medium-grey: #878b8f;

body {
  font-family: $open-sans !important;
  width: 100%;
  color: $dark-grey !important;
  background-color: $white !important;
  margin: 0;
  padding: 0;
}

.hide-on-desktop {
  display: none !important;
}
.show-on-desktop {
  display: block !important;
}

@media (max-width: 700px) {
  .hide-on-mobile {
    display:none !important
  }
  .show-on-mobile {
    display:block !important
  }
  .last-of-type-on-mobile {
    margin-bottom:0 !important
  }
}

.last-of-type {
  margin-bottom: 0 !important
}

.meta {
  width: 100%;
  border-bottom: 1px solid #d1d1d1;
  font-family: $roboto-mono;
  text-align: center;
  font-size: 13px;
  background-color: $light-grey;
  padding: 1em 0;
  line-height: 1.8;

  form {
    padding: 0 1em;
  }

  input[type=email] {
    max-width: 100px;
  }

  input::placeholder {
    color: $dark-grey;
    opacity: .75;
  }
}

.content {
  margin-bottom: 32px;
  &:last-of-type { margin-bottom: 0 !important; }

  h1, h2, h3, h4 {
    color: $black;

    a {
      color: $black;
      font-weight: unset;
      &:hover {
        color: $green;
      }
    }
  }

  h1 {
    font-family: $open-sans;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.4;
    margin: 30px 0 15px 0;
  }
  h2 {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.4;
    margin: 50px 0 20px 0;
  }
  h3 {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin: 40px 0 20px 0;
  }
  h4 {
    font-family: $roboto-mono;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.2;
    margin: -10px 0 20px 0;
  }
  // only used for subtitle
  h5 {
    font-family: $roboto-mono;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.2;
    margin: 0 0 65px 0;
  }
  a {
    font-weight: bold;
    color: $green;
    text-decoration: underline;
    &:hover {
      text-decoration: underline;
      color: $black;
    }
  }
  p, li {
    font-size: 17px;
    line-height: 1.6;
    bold {
      font-weight: bold;
    }
  }
  p {
    margin: 0 0 20px 0;
    img {
      max-width: 100%;
      margin: 0 0 0 0;
    }
    @media (max-width: 700px) {
      img {
        max-width:100%;
        margin: 10px 0;
      }
    }
  }
  p code, li code {
    background-color: #f8f8f8;
    border: 1px solid #eaeaea;
    border-radius: 3px;
    color: inherit;
    font-family: $roboto-mono;
    font-size: 12px;
    margin: 0 2px;
    padding: 2px 5px;
  }
  em {
    font-style: italic;
  }
  hr {
    border: none;
    height: 1px;
    background-color: #d1d1d1;
    margin: 50px 0 30px 0;
  }
  blockquote {
    color: inherit;
    border-left: 2px solid $green !important;
    margin: 25px 0;
    padding: 0 0 0 25px;
    p {
      line-height: 1.7;
    }
  }

  ul, ol {
    margin: 30px 0;
    padding-left: 20px;
  }
  li {
    margin: 0 0 15px 0;
  }

  code, pre {
    margin: 0;
    padding: 0;
  }
  pre {
    display: block;
    width: 100%;
    margin: 0 0 20px 0;
    code { display: block; }
  }
  code {
    display: inline-block;
    background-color: #202020;
    color: #f0f0f0;
    font-family: $roboto-mono;
    font-size: 15px;
    padding: 15px;
  }

}

@media (max-width: 700px) {
  table { width: 100%; }
}

.header {
  a {
    color: $dark-grey;
    text-decoration: none;

    &:hover {
      color: $green;
      text-decoration: underline;
    }
  }

  p {
    font-size: 12px;
    line-height: 1.5;
    margin: 0 0 20px 0;
    padding: 0 40px
  }
}

.footer {
  a {
    color: $dark-grey;

    &:hover {
      color: $green;
    }
  }

  p {
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 20px 0;
    padding: 0 40px
  }
}

.spacer-10 { display:block; height: 10px; width: 1px; }
.spacer-20 { display:block; height: 20px; width: 1px; }

@media (prefers-color-scheme: dark) {
  body {
    color: $off-white !important;
    background-color: $black !important;
  }

  .meta {
    color: $off-white;
    background-color: $dark-blue;
    border-bottom: 1px solid $medium-grey;

    input::placeholder {
      color: $off-white;
    }
  }

  .content {
    h1, h2, h3, h4 {
      color: $off-white;

      a {
        color: $off-white;

        &:hover {
          color: $green;
        }
      }
    }

    a {
      &:hover {
        color: $off-white;
      }
    }

    p code, li code {
      background-color: #333333;
      border: 1px solid #212121;
    }
  }

  .footer, .header {
    color: $off-white;

    a {
      color: $off-white;

      &:hover {
        color: $green;
      }
    }

    @media (max-width: 700px) { background-color: $dark-grey; }
  }
}
